#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
void math(char* left, char* right)
{
    while (right-left>0)
    {
        char a = *left;
        *left++= *right;
        *right-- = a;
    }
}
int main()
{
    char arr[100];
    scanf("%[^\n]", arr);
    int sz = strlen(arr) - 1;
    math(&arr[0], &arr[sz]);
    char* left = arr;
    char* right = arr;
    while (*right)
    {
        while (*right)
        {
            if (*right != ' ' && *right != '\0')
            {
                right++;
            }
            else
                break;
        }
        math(left, right-1);
        left = ++right;
    }
    printf("%s", arr);
    return 0;
}